@push('stylesheets')
    <link href="{{ URL::asset('/static/web/css/plugins/sweetalert/sweetalert.css')}}?v=33" rel="stylesheet">
@endpush
备注：{{$item->remark}}
<br/>
<a href="{{route('order.detail',['oid'=>$item->id])}}"
   class="btn btn-success"><i class="fa fa-file-text-o"></i> 订单详情</a>
@section('script')
     <script>
         layui.use(['laydate', 'element'], function () {
             var laydate = layui.laydate, element = layui.element;
             //日期时间选择器
             laydate.render({
                 elem: '.start_time'
                 , type: 'datetime'
             });
             laydate.render({
                 elem: '.end_time'
                 , type: 'datetime'
             });
         });
         require(["{{ URL::asset('/static/web/js/plugins/sweetalert/sweetalert.min.js')}}"], function (swal) {
             layui.use(['laydate', 'element'], function () {
                 $(".order_remark").click(function () {
                     var oid = $(this).parent().parent().data('id');
                     swal({
                         title: '订单备注',
                         input: 'textarea',
                         confirmButtonText: "提交",
                         cancelButtonText: "取消",
                         showCancelButton: true
                     }).then(function(result) {
                         var remark = result.value;
                         if(remark && result.dismiss!='cancel'){
                             var index = layer.load(0);
                             $.ajax({
                                 url: '{{route("order.remark")}}',
                                 type: 'POST',
                                 data: {oid:oid,remark:remark},
                                 dataType: "json",
                                 success: function (result) {
                                     layer.close(index);
                                     if (result.errno || result.errno == 0) {
                                         layer.msg(result.message, {time: 2000, icon: 6});
                                     } else {
                                         layer.msg(result.message, {time: 2000, icon: 5});
                                     }
                                 }
                             });
                         }

                     })
                 })
             });
         })
     </script>
 @endsection